package com.racheiros.model;

import java.util.*;
import java.sql.*;

public class Login {
	private String UserName;
	private String PassWord;
	public Login(String UserName, String PassWord) {
		setUserName(UserName);
		setPassWord(PassWord);
	}
	public String getUserName() {
		return UserName;
	}
	public void setUserName(String UserName) {
		this.UserName = UserName;
	}
	public String getPassWord() {
		return PassWord;
	}
	public void setPassWord(String PassWord) {
		this.PassWord = PassWord;
	}
	public static void main(String[] args) {
		Scanner ler  = new Scanner(System.in);
		Login Log = new Login( "LOGIN", "SENHA");
	}

	public String Logar(String s) {
		String url = "http://127.0.0.1";
		String login = "root";
		String senha = "admin123";
		try {
			Class.forName("com.mysql.jdbc.Driver").newInstance();
			try {
				Connection conn = DriverManager.getConnection(url,login,senha);
				try {
					String sql = s;
					Statement stm = conn.createStatement();
					try {
						ResultSet rs = stm.executeQuery(sql);
					} catch (Exception ex) {
						System.out.println(ex);
					}
				} catch (Exception ex) {
					System.out.println("\nErro no statement!");
				}
			} catch (Exception ex) {
				System.out.println("\nErro no connection! " + ex);
			}
		} catch (Exception ex) {
			System.out.println("\nDriver nao pode ser carregado!");
		}
		return Logado();
	}

	public String Logado(){
		System.out.println("logado");
		return "logado";
	}
}
